package views;

import javax.swing.*;
import java.awt.*;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class PesronViews {


    static  final  String JDBC_DRIVER = "com.mysql.jdbc.Driver";
    static  final  String DB_URL = "jdbc:mysql://192.168.126.129:20000/tour";
    static  final  String USER= "swpu_user";
    static  final  String PASS = "2121709a*";
    /*添加到数据库所必需的代码*/
    static Connection connect = null;
    static PreparedStatement cmmd = null;
    static ResultSet rs = null;
    static String sql = "";


    JLabel labpassword;
    JLabel l1;
    JLabel l2;
    JLabel l3;
    JTextField txtrest;
    JTextField txtin;
    JTextField txtout;
    JButton btnOK;
    JButton btn1;
    JButton btn2;
    JButton btn3;
    TextArea area;


    class PanelBg extends  JPanel{
        Dimension d;
        Image image;
        PanelBg(Dimension d,Image image){
            this.d=d;
            this.image=image;
        }
        @Override
        public void paintComponent(Graphics g){
            g.drawImage(image,0,0,d.width,d.height,this);
        }
    }
    Dimension fmsize=new Dimension(600,700);
    ImageIcon imageicon = new ImageIcon(this.getClass().getResource("/erhai7.jpg"));

  PesronViews(){

        JFrame jframe = new JFrame();
        jframe.setSize(600,700);
        jframe.setDefaultCloseOperation(jframe.DISPOSE_ON_CLOSE);
        jframe.setLayout(null);
        jframe.setLocationRelativeTo(null);


        PanelBg pContent = new PanelBg(fmsize,imageicon.getImage());
        pContent.setLayout(null);
        pContent.setBounds(0,0,600,700);
        jframe.getContentPane().add(pContent);



      l1 = new JLabel("XX");
      l1.setBounds(100,200,50,30);
      pContent.add(l1);

      txtrest = new JTextField();
      txtrest.setBounds(180,200,300,40);
      pContent.add(txtrest);


      l2 = new JLabel("XX");
      l2.setBounds(100,300,50,30);
      pContent.add(l2);

      txtin = new JTextField();
      txtin.setBounds(180,300,300,40);
      pContent.add(txtin);


      btn3 =new JButton("保存");
      btn3.setBounds(100,500,70,30);
      pContent.add(btn3);


      btnOK = new JButton("重置");
      btnOK.setBounds(400,500,70,30);
      pContent.add(btnOK);

      jframe.setVisible(true);

    }

    public static void main(String[] args) {
        new  PesronViews();
    }

}
